<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return['diy']=$this->plugin_setting('diy');
$basic=$this->plugin_setting('basic');
$return['banner']=$basic['image'];
if($_RQ['op']=='main'){
	/*******main*******/
	//首页轮播图
	$basic=$this->plugin_setting('basic');
	//首页推荐服务人员和项目
	$worker_show=pdo_getall('jy_meiye_worker',array('uniacid'=>$_SESSION['uniacid'],'isshow'=>'1','status'=>'1','islock'=>'0'));
	if($worker_show){
		foreach($worker_show as &$item){
			$num1=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'worker_id'=>$item['id'],'status'=>'1'));
			$num2=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'worker_id'=>$item['id'],'status'=>'2'));
			$num3=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'worker_id'=>$item['id'],'status'=>'4'));
			$item['num']=$num1+$num2+$num3;
		}
	}
	$serve_show=pdo_getall('jy_meiye_serve',array('uniacid'=>$_SESSION['uniacid'],'isshow'=>'1','status'=>'1'));
	if($serve_show){
		foreach($serve_show as &$item){
			$num1=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'serve_id'=>$item['id'],'status'=>'1'));
			$num2=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'serve_id'=>$item['id'],'status'=>'2'));
			$num3=pdo_count('jy_meiye_order',array('uniacid'=>$_SESSION['uniacid'],'serve_id'=>$item['id'],'status'=>'4'));
			$item['num']=$num1+$num2+$num3;
		}
	}
	$return['worker_show']=$worker_show;
	$return['serve_show']=$serve_show;
	$return['logo']=$basic['logo']?tomedia($basic['logo']):tomedia('../addons/jy_meiye/resource/images/logo.jpg');
	set_html('title',$return['pluginset']['title']?:'在线美发');
	exi($return);
}